#include "PointEntity.h"
#include "Common.h"

namespace FinalRendering
{
	namespace Plugin
	{
		PointEntity::PointEntity()
		{
		}

		PointEntity::PointEntity(Stream * stream)
		{
			stream->ReadBuffer(&Position, 1);
		}

		int PointEntity::GetPropertyCount()
		{
			return 1;
		}
		PropertyDesc PointEntity::GetPropertyDesc(int i)
		{
			PropertyDesc rs;
			switch (i)
			{
			case 0:
				rs.PropertyName = L"Position";
				rs.PropertyType = L"Vec3";
				rs.Value = &Position;
				break;
			}
			return rs;
		}
		
		bool PointEntity::Serialize(Stream * stream)
		{
			stream->WriteBuffer(&Position,1);
			return true;
		}
		int PointEntity::ProcessMessage(IEntity * sender, EntityMessage msg)
		{
			throw gxArgumentException();
			return 1;
		}
		void PointEntity::Step(float dTime)
		{

		}
		const wchar_t * PointEntity::GetName()
		{
			return Name.GetStrPtr();
		}
		void PointEntity::SetName(const wchar_t * name)
		{
			Name = name;
		}

		void PointEntity::GetVolume(Volume * vol)
		{
			vol->Type = Volume::Point;
			vol->Position = Position;
		}
		void PointEntity::EditorDraw(IView *view)
		{
	
		}
	}
}